package cn.yunbamboos.mybatis.metadata.where;

import cn.yunbamboos.mybatis.Constants;
import org.apache.ibatis.scripting.xmltags.SqlNode;
import org.apache.ibatis.session.Configuration;

import java.util.Optional;

public abstract class TableWhere implements Constants {

    public abstract Optional<SqlNode> createSqlNode(Configuration configuration);


    public String getNotNullTest(String column) {
        return CONDITIONS + DOT + column + SPACE + EXCLAMATION_MARK + EQUALS + SPACE + NULL;
    }

    public String getNotEmptyTest(String column) {
        return CONDITIONS + DOT + column + SPACE + EXCLAMATION_MARK + EQUALS + SPACE + SINGLE_QUOTE + SINGLE_QUOTE;
    }
}
